Skip to content

Conversation

SantosVilanculos
Copy link
Contributor

This pull request refactors the onChange handler for the avatar file input to correctly capture and set the File object in the form data instead of the input's string value.

@SantosVilanculos SantosVilanculos changed the title fix: correctly set file data for avatar fix(precognition): correctly set file data for avatar Oct 3, 2025
@taylorotwell taylorotwell marked this pull request as draft October 3, 2025 21:11
@timacdonald
Copy link
Member

Thanks! I've updated the example to match the Vue example.

@timacdonald timacdonald self-assigned this Oct 7, 2025
@timacdonald timacdonald marked this pull request as ready for review October 7, 2025 22:23
@taylorotwell taylorotwell merged commit 0714aa1 into laravel:12.x Oct 8, 2025
type="file"
onChange={(e) => {
form.setData('avatar', e.target.value);
form.setData('avatar', e.target.files[0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it’s broken? Missing ] at the end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants